import request from '@/utils/request'

// 查询事件指标
export function getMeasuresApi (parameter) {
  return request({
    url: '/datasource/'+ parameter.id +'/measure',
    // url: '/mock/66/datasource/'+ parameter.id +'/measure',
    method: 'get',
    data: parameter,
  })
}
// 查询事件列表
export function getEventsApi (parameter) {
  return request({
    url: '/datasource/'+ parameter.id +'/event',
    // url: '/mock/66/datasource/'+ parameter.id +'/event',
    method: 'get',
    data: parameter,
  })
}

// 查询事件属性列表
export function getPropertiesEventApi (parameter) {
  return request({
    url: '/datasource/'+ parameter.id +'/event/property',
    // url: '/mock/66/datasource/'+ parameter.id +'/event/property',
    method: 'get',
    data: parameter
  })
}

// 查询用户属性列表
export function getPropertiesUserApi (parameter) {
  return request({
    url: '/datasource/'+ parameter.id +'/user/property',
    // url: '/mock/66/datasource/'+ parameter.id +'/user/property',
    method: 'get',
    data: parameter
  })
}

// 查询用户标签列表
export function getPropertiesOfUserTagApi (parameter) {
  return request({
    url: '/datasource/'+ parameter.id +'/user/tag',
    method: 'get',
    data: parameter
  })
}

export function getMetaUserPropertiesApi(params) {
  return request({
    url: '/metadata/user/property',
    method: 'get',
    params:params
  })
}

export function getEventValueApi (parameter) {
  return request({
    url: '/datasource/'+ parameter.id +'/event/property/' + parameter.propertyName + '/value',
    // url: 'http://10.8.0.1:3000/mock/66/datasource/'+ parameter.id +'/event/property/' + parameter.propertyName + '/value',
    method: 'get',
    params: {keyword: parameter.keyword}
  })
}

export function getEventValuesByProjectIdApi (parameter) {
  return request({
    url: '/project/'+ parameter.projectId +'/event/property/' + parameter.propertyName + '/value',
    method: 'get',
    params: parameter
  })
}

export function getUserValueApi (parameter) {
  return request({
    url: '/datasource/'+ parameter.id +'/user/property/' + parameter.propertyName + '/value',
    // url: '/mock/66/datasource/'+ parameter.id +'/user/property',
    method: 'get',
    params: {keyword: parameter.keyword}
  })
}

export function getUserValuesByProjectIdApi(parameter) {
  return request({
    url: '/project/'+ parameter.projectId +'/user/property/' + parameter.propertyName + '/value',
    method: 'get',
    data: parameter
  })
}

